<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	    <link rel="stylesheet" href="../css/amazeui.min.css" th:href="@{/static/css/amazeui.min.css}" media="all">
		<link rel="stylesheet" href="../css/admin.css" th:href="@{/static/css/admin.css}" media="all">
		<link rel="stylesheet" href="../css/app.css" th:href="@{/static/css/app.css}" media="all">
		<link rel="stylesheet" type="text/css" href="../layuiadmin/layui/css/layui.css" th:href="@{/static/layuiadmin/layui/css/layui.css}" media="all">
		<link rel="stylesheet" type="text/css" href="../layuiadmin/layui/css/layui.css" th:href="@{/static/layuiadmin/layui/css/layui.css}" media="all">
		<script type="text/javascript" src="../js/jquery-1.9.1.min.js" th:src="@{static/js/jquery-1.9.1.min.js}"></script>
		<script src="../layuiadmin/layui/layui.js" th:src="@{/static/layuiadmin/layui/layui.js}" charset="utf-8" type="text/javascript"></script>
		<style>
			.admin-main{
				padding-top: 0px;
			}
		</style>
		<script type="text/javascript">
/* 			$(function(){
				$("[class='am-btn am-btn-success']").click(function(){
					var papername = $("[id='doc-vld-pwd-1']").val();
					var papertime = $("[id='doc-vld-pwd-2']").val();
					$.ajax({
						type:"get",
						url:"addpaper",
						async:true,
						dataType:"text",
						data:{'papername':papername,'papertime':papertime},
						success:function(e){
							if(e == "true"){
								alert("添加成功,请前往我的考试界面查看")
							}else if(e == "false1"){
								alert("未选择题目，添加失败")
							}else{
								alert("服务异常")
							}
						parent.closeAll();
//						parent.location.href="toMyPaper"

						},
						
					});
			})
			}) */
			layui.use(['layer', 'form', 'element'], function () {
				var layer = layui.layer, form = layui.form, element = layui.element
				$ = layui.$
				$("[class='am-btn am-btn-success']").click(function(){
					var bankname = $("[id='doc-vld-pwd-1']").val();
/* 					var papertime = $("[id='doc-vld-pwd-2']").val(); */
					var banktype = $("[id='papertype']").val();
/* 					alert(papertype) */
//					alert(1);
//					alert(papername);
					$.ajax({
						type:"get",
						url:"addbank",
						async:false,
						dataType:"text",
						data:{'bankname':bankname,"banktype":banktype},
						success:function(e){
							if(e == "false1"){
								alert('添加失败');
								window.parent.layer.closeAll();
							}else{								
								alert('添加成功！');
								window.parent.layer.closeAll();
							}

						},
 						
						error:function(e){
							alert('系统异常！');
							window.parent.layer.closeAll();
						} 
					});
			});				
			});
		</script>
	</head>
	<body class="addpaper">
		<div class="am-cf admin-main">
		<!-- content start -->
		<div class="admin-content">
			<div class="admin-content-body">
				<div class="am-g">
					<form class="am-form am-form-horizontal" method="post" style="padding-top:20px;" data-am-validator >
						<div class="am-form-group" align="left" >
							<label for="user-name" class="am-u-sm-3 am-form-label">
							题库名: </label>
							<div class="am-u-sm-9">
								<input type="text" id="doc-vld-pwd-1" required placeholder="请输入题库名称" 
									style="width: 300px;" name="papername"> <small></small>
							</div>
						</div>
						<!--<div class="am-form-group" align="left" style="margin-top: 8%">
							<label for="user-name" class="am-u-sm-3 am-form-label">
								考试时长:</label>
							<div class="am-u-sm-9">
								<input type="text" id="doc-vld-pwd-2" required placeholder="请输入考试时长（以分钟为单位）" 
									 style="width: 300px;" name="papertime" > <small></small>
							</div>
						</div>-->
						<div class="am-form-group" align="left" style="margin-top: 8%">
							<label for="user-name" class="am-u-sm-3 am-form-label">
								题库类型:</label>
							<div class="am-u-sm-9">
								<select name="city" lay-verify=""  style="width: 300px;" id="papertype">
								  <option value="1">请选择题库类型</option>
								  <option value="1">IT技术</option>
								  <option value="2">IQ&EQ</option>
								  <option value="3">招聘真题</option>
								  <option value="4">资格证书</option>
								  <option value="5">学历教育</option>
								  <option value="6">培训学习</option>
								  <option value="7">综合测试</option>
								</select>
							</div>
						</div>
						<div class="am-form-group" style="margin-left: 20%; margin-top: 8%">
							<div class="am-u-sm-9 am-u-sm-push-3">
								<input type="submit" class="am-btn am-btn-success" value="确认添加" />
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	</script> 
	<script type="text/javascript" src="static/myplugs/js/plugs.js" th:src="@{static/myplugs/js/plugs.js}">
	</script>
	</body>
</html>
